package com.xiaolin.security;

import java.util.Base64;

/**
 * @ClassName TestBase64
 * @Description TODO
 * @Detail detail
 * @Author MyPC
 * @Date 2020/9/27
 * @Version 1.0
 */
public class TestBase64 {
    public static void main(String[] args) {
        //对字符串进行编码
        byte[] encode = Base64.getEncoder().encode("hello".getBytes());
        //对字符串进行解码
        byte[] decode = Base64.getDecoder().decode(encode);
        //将字节数组转成字符串
        System.out.println(new String(decode));
    }
}
